from selenium.webdriver.common.by import By

from autoTest_ecshop.base_page.base import BasePage


class ShopCartPage(BasePage):
    # 获取支付中心按钮定位器
    payProduct_loc = (By.XPATH,'/html/body/div[7]/div[1]/table/tbody/tr/td[2]/a')

    # 商品名定位器
    productName_loc = (By.XPATH,'//*[@id="formCart"]/table[1]/tbody/tr[2]/td[1]/a[2]')


    def goToThePaymentCenter(self):
        self.btn_click(self.payProduct_loc)

    def productPageAssertion(self):
        return self.element_text(self.productName_loc)

